package com.sky.service.impl;

import com.sky.dto.ShoppingCartDTO;
import com.sky.service.ShopService;
import lombok.extern.slf4j.Slf4j;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.core.ValueOperations;
import org.springframework.stereotype.Service;

@Service
@Slf4j
public class ShopServiceImpl implements ShopService {
    @Autowired
    private RedisTemplate redisTemplate;
    private final String SHOP_STATUS_KEY="shop_status";
    @Autowired
    ValueOperations valueOperations;
    @Override
    public void setStatus( Integer status) {
        log.info("店铺状态修改为：{}",status);
        valueOperations.set(SHOP_STATUS_KEY,status);
    }

    @Override
    public Integer getStatus() {
        return (Integer) valueOperations.get(SHOP_STATUS_KEY);
    }

}
